/*
 * RecordMediaPlayer.cpp
 *
 *  Created on: 2018年8月2日
 *      Author: zhengboyuan
 */
#include "stdafx.h"
#include "RecordMediaPlayer.h"

RecordMediaPlayer::RecordMediaPlayer()
{

}

RecordMediaPlayer::~RecordMediaPlayer()
{
}

bool RecordMediaPlayer::CanSeek()
{
    return true;
}

bool RecordMediaPlayer::Open(nvs::NetVideoSystem* system, const nvs::RecordItem& rec)
{
    if (!system)
    {
        return false;
    }

    m_rec = rec;

    nvs::MediaStream* stream = NULL;
    int ret = system->openRecordStream(rec, &stream);
    if (ret != nvs::NVS_ERR_OK)
    {
        return false;
    }

    return MediaStreamPlayer::Open(system, stream);
}

const nvs::RecordItem& RecordMediaPlayer::getRecord() const
{
    return m_rec;
}

std::string RecordMediaPlayer::GetUrl()
{
    return m_rec.id;
}
